<?php
$base_url = site_url();
$action = $base_url.'unite/createDB';
$UNITE_ID = null;
$UNITE_LIBELLE = null;
$UNITE_CODE = null;
if(isset($unite)) {
    $action = site_url().'unite/updateDB';
    $UNITE_ID = $unite->UNITE_ID;
    $UNITE_LIBELLE = $unite->UNITE_LIBELLE;
    $UNITE_CODE = $unite->UNITE_CODE;
}
?>

<form action="<?php echo $action; ?>">
    <input type="hidden" id="UNITE_ID" value="<?php echo $UNITE_ID; ?>" />
    <fieldset>
        <legend>Unité</legend>
        <div>
            <label for="UNITE_LIBELLE">Nom de l'unité</label>
            <input type="text" name="UNITE_LIBELLE" id="UNITE_LIBELLE" required="required" value="<?php echo $UNITE_LIBELLE; ?>" />
        </div>
        <div>
            <label for="UNITE_CODE">Code</label>
            <input type="text" name="UNITE_CODE" id="UNITE_CODE" required="required" value="<?php echo $UNITE_CODE; ?>" />
        </div>
    </fieldset>
</form>